<%--
  Created by IntelliJ IDEA.
  User: l
  Date: 2022/8/6
  Time: 11:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>好物列表</title>
    <style>
        table{
            width: 1000px;
            margin: 0 auto;
        }
        #box{
            width: 1000px;
            height: 20px;
            margin: 0 auto;
            text-align: left;
        }
    </style>
    <script src="js/jquery-3.6.0.js"></script>
    <script>
        $(function () {

        })
    </script>
</head>
<body>
    <table cellpadding="0" cellspacing="0" border="1">
        <tr>
            <td>编号</td>
            <td>名称</td>
            <td>价格</td>
            <td>上架时间</td>
            <td>操作</td>
        </tr>
        <c:forEach var="goods" items="${allGoodsList}">
            <tr>
                <td>${goods.gid}</td>
                <td>${goods.gname}</td>
                <td>${goods.price}</td>
                <td>${goods.registerdate}</td>
                <td>
                    <a href="Goods?opr=getOne&gid=${goods.gid}">查看物品详情</a>
                </td>
            </tr>
        </c:forEach>
    </table>
    <div id="box">
        <c:if test="${Page.currentPage>1}">
            <a href="Goods?opr=getAll&currentPage=1">第一页</a>
            <a href="Goods?opr=getAll&currentPage=${Page.currentPage-1}">上一页</a>
        </c:if>
        <c:if test="${Page.currentPage<Page.pages}">
            <a href="Goods?opr=getAll&currentPage=${Page.currentPage+1}">下一页</a>
            <a href="Goods?opr=getAll&currentPage=${Page.pages}">最后一页</a>
        </c:if>
        <p>
            <a href="javascript:history.back();">返回上一页</a>
        </p>
    </div>
</body>
</html>
